home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / T-Z / Weight Loss.sea / Weight Loss / card_4263.txt < prev    next >
Text File  |  1990-10-04  |  46KB  |  1,799 lines

  1. -- card: 4263 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4593
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on enterinfield
  8.   global Holder1
  9.   put the number of the target into holder1
  10.   put number of lines of card field 1 into maxlines
  11.   if holder1<2 then select line maxlines of card field (holder1+1) else select line maxlines+1 of card field (holder1-1)
  12. end enterinfield
  13.  
  14.  
  15.  
  16.  
  17.  
  18. -- part 23 (field)
  19. -- low flags: 00
  20. -- high flags: 4007
  21. -- rect: left=173 top=93 right=253 bottom=274
  22. -- title width / last selected line: 0
  23. -- icon id / first selected line: 0 / 0
  24. -- text alignment: 0
  25. -- font id: 3
  26. -- text size: 12
  27. -- style flags: 0
  28. -- line height: 16
  29. -- part name: Date
  30.  
  31.  
  32. -- part 24 (field)
  33. -- low flags: 00
  34. -- high flags: 4007
  35. -- rect: left=257 top=93 right=253 bottom=361
  36. -- title width / last selected line: 0
  37. -- icon id / first selected line: 0 / 0
  38. -- text alignment: 1
  39. -- font id: 3
  40. -- text size: 12
  41. -- style flags: 0
  42. -- line height: 16
  43. -- part name: Weight
  44. ----- HyperTalk script -----
  45. on mouseWithin
  46.   put the number of lines of card field "weight" into maxlines
  47.   put the scroll of card field "weight" into align
  48.   put round(align/16) into invis
  49.   if maxlines-invis = 10 then select line maxlines+1 of card field "weight"
  50.   if maxlines-invis = 10 then select line maxlines+1 of card field "date"
  51.   else set the scroll of card field "date" to align
  52. end mouseWithin
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. -- part 2 (field)
  61. -- low flags: 81
  62. -- high flags: 2002
  63. -- rect: left=135 top=28 right=224 bottom=443
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 0
  67. -- font id: 3
  68. -- text size: 14
  69. -- style flags: 0
  70. -- line height: 18
  71. -- part name: About
  72. ----- HyperTalk script -----
  73. on mouseUp
  74.   hide card field "About"
  75. end mouseUp
  76.  
  77.  
  78.  
  79. -- part 17 (button)
  80. -- low flags: 00
  81. -- high flags: 8006
  82. -- rect: left=16 top=59 right=77 bottom=169
  83. -- title width / last selected line: 0
  84. -- icon id / first selected line: 0 / 0
  85. -- text alignment: 1
  86. -- font id: 0
  87. -- text size: 12
  88. -- style flags: 0
  89. -- line height: 16
  90. -- part name: Preferred lbs/week
  91. ----- HyperTalk script -----
  92. on mouseUp
  93.   put line 2 of card field "y" into y
  94.   put line 2 of card field "wT now" into wtNow
  95.   ask "Preferred weight loss per week ? "
  96.   put it into wlpw
  97.   put the date into date1
  98.   convert date1 to seconds
  99.   put (wtNow-y)/wlpw into weeks
  100.   put round(weeks*7)*24*60*60 into seconds
  101.   put date1 + seconds into date2
  102.   convert date2 to abbr date
  103.   put "No. of weeks = " & round(weeks*10)*.1 &"     " & "Date = " & date2
  104. end mouseUp
  105.  
  106.  
  107.  
  108. -- part 19 (button)
  109. -- low flags: 00
  110. -- high flags: 8006
  111. -- rect: left=16 top=78 right=99 bottom=141
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Preferred Date
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   put line 2 of card field "y" into y
  123.   put line 2 of card field "wT now" into wtNow
  124.   ask "Preferred Date ? "
  125.   put it into date2
  126.   put the date into date1
  127.   convert date1 to seconds
  128.   convert date2 to seconds
  129.   put date2-date1 into seconds
  130.   put wtNow-y into wtLoss
  131.   put "lbs/week = " & round(wtLoss/seconds*60*60*24*7*10)*.1
  132. end mouseUp
  133.  
  134.  
  135.  
  136. -- part 22 (button)
  137. -- low flags: 80
  138. -- high flags: A003
  139. -- rect: left=401 top=55 right=74 bottom=491
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 1
  143. -- font id: 0
  144. -- text size: 12
  145. -- style flags: 0
  146. -- line height: 16
  147. -- part name: Enter Data
  148. ----- HyperTalk script -----
  149. on mouseUp
  150.   hide card button "calories"
  151.   hide card button "Home"
  152.   Hide card button "Enter Data"
  153.   show card button "Get Equation"
  154.   hide card button "view graph"
  155.   hide background button "reset"
  156.   hide card button "plot it"
  157.   hide card button "calculate"
  158.   hide card field "Equation"
  159.   hide card field "twlp"
  160.   hide card field "Target Date"
  161.   hide card field "f1"
  162.   hide card field "f2"
  163.   hide card field "f3"
  164.   hide card field "f4"
  165.   hide card field "f5"
  166.   hide card field "f6"
  167.   hide card field "f7"
  168.   hide card field "f8"
  169.   hide card field "wtl"
  170.   hide card field "weeks"
  171.   hide card field "awl"
  172.   hide card field "wt loss"
  173.   hide card field "WOD"
  174.   hide card field "mean loss"
  175.   show card button "mask1"
  176.   show card button "mask2"
  177.   show card button "mask3"
  178.   hide card field "y"
  179.   hide card field "wt now"
  180.   show card field "title1"
  181.   show card field "title2"
  182.   show card field "Date"
  183.   show card field "Weight"
  184.   show card button "Store Data"
  185.   show card button "Retrieve Data"
  186.   show card button "Exchange Data"
  187.   show card button "clear data"
  188.   show card button "Check Errors"
  189. end mouseUp
  190.  
  191.  
  192.  
  193.  
  194.  
  195. -- part 25 (field)
  196. -- low flags: 00
  197. -- high flags: 0002
  198. -- rect: left=173 top=77 right=94 bottom=258
  199. -- title width / last selected line: 0
  200. -- icon id / first selected line: 0 / 0
  201. -- text alignment: 1
  202. -- font id: 3
  203. -- text size: 12
  204. -- style flags: 256
  205. -- line height: 16
  206. -- part name: Title1
  207.  
  208.  
  209. -- part 26 (field)
  210. -- low flags: 00
  211. -- high flags: 0002
  212. -- rect: left=257 top=77 right=94 bottom=361
  213. -- title width / last selected line: 0
  214. -- icon id / first selected line: 0 / 0
  215. -- text alignment: 1
  216. -- font id: 3
  217. -- text size: 12
  218. -- style flags: 256
  219. -- line height: 16
  220. -- part name: Title2
  221.  
  222.  
  223. -- part 27 (field)
  224. -- low flags: 80
  225. -- high flags: 2000
  226. -- rect: left=175 top=68 right=87 bottom=371
  227. -- title width / last selected line: 0
  228. -- icon id / first selected line: 0 / 0
  229. -- text alignment: 0
  230. -- font id: 2
  231. -- text size: 10
  232. -- style flags: 0
  233. -- line height: 13
  234. -- part name: Equation
  235.  
  236.  
  237. -- part 29 (field)
  238. -- low flags: 80
  239. -- high flags: 2004
  240. -- rect: left=43 top=113 right=147 bottom=178
  241. -- title width / last selected line: 0
  242. -- icon id / first selected line: 0 / 0
  243. -- text alignment: 1
  244. -- font id: 2
  245. -- text size: 10
  246. -- style flags: 256
  247. -- line height: 13
  248. -- part name: Wt now
  249.  
  250.  
  251. -- part 28 (field)
  252. -- low flags: 80
  253. -- high flags: 2004
  254. -- rect: left=175 top=113 right=147 bottom=325
  255. -- title width / last selected line: 0
  256. -- icon id / first selected line: 0 / 0
  257. -- text alignment: 1
  258. -- font id: 2
  259. -- text size: 10
  260. -- style flags: 256
  261. -- line height: 13
  262. -- part name: y
  263.  
  264.  
  265. -- part 31 (button)
  266. -- low flags: 00
  267. -- high flags: 0001
  268. -- rect: left=361 top=50 right=293 bottom=495
  269. -- title width / last selected line: 0
  270. -- icon id / first selected line: 0 / 0
  271. -- text alignment: 1
  272. -- font id: 0
  273. -- text size: 12
  274. -- style flags: 0
  275. -- line height: 16
  276. -- part name: Mask1
  277.  
  278.  
  279. -- part 32 (button)
  280. -- low flags: 00
  281. -- high flags: 0001
  282. -- rect: left=171 top=270 right=325 bottom=498
  283. -- title width / last selected line: 0
  284. -- icon id / first selected line: 0 / 0
  285. -- text alignment: 1
  286. -- font id: 0
  287. -- text size: 12
  288. -- style flags: 0
  289. -- line height: 16
  290. -- part name: Mask2
  291.  
  292.  
  293. -- part 30 (button)
  294. -- low flags: 00
  295. -- high flags: 0001
  296. -- rect: left=13 top=36 right=321 bottom=170
  297. -- title width / last selected line: 0
  298. -- icon id / first selected line: 0 / 0
  299. -- text alignment: 1
  300. -- font id: 0
  301. -- text size: 12
  302. -- style flags: 0
  303. -- line height: 16
  304. -- part name: Mask3
  305.  
  306.  
  307. -- part 33 (button)
  308. -- low flags: 80
  309. -- high flags: 8003
  310. -- rect: left=219 top=36 right=55 bottom=310
  311. -- title width / last selected line: 0
  312. -- icon id / first selected line: 0 / 0
  313. -- text alignment: 1
  314. -- font id: 0
  315. -- text size: 12
  316. -- style flags: 0
  317. -- line height: 16
  318. -- part name: Calculate
  319. ----- HyperTalk script -----
  320. on mouseUp
  321.   hide background button "Reset"
  322.   put empty into r
  323.   get the visible of card button "view graph"
  324.   if it is true then hide card button "plot it" else show card button "plot it"
  325.   put card field "date1" into date1
  326.   put card field "weight1" into weight1
  327.   put card field "weight2" into weight2
  328.   ask "What is Target Weight(lbs) ? "
  329.   put it into r
  330.   if r is empty then get line 2 of card field "y"
  331.   if r is empty then put it into line 2 of card field "y" else put r into line 2 of card field "y"
  332.   put line 1 of card  field "Equation" into equation
  333.   put offset ("e",Equation) into divider1
  334.   put offset (")",Equation) into divider2
  335.   put char 3 to divider1-2 of equation into a
  336.   put char divider1+4 to divider2-3 of equation into b
  337.   put line 2 of card field "y" into y
  338.   put round(Ln(y/a)/b) into days
  339.   put the date into date3
  340.   convert date1 to seconds
  341.   convert date3 to seconds
  342.   put (date3 - date1)/60/60/24 into period
  343.   put (round(period/7*10))*.1 into card field "wod"
  344.   put (round((days - period)/0.7))*.1 into card field "Weeks"
  345.   put date1 + days * 60 * 60 * 24 into date2
  346.   convert date2 to abbr date
  347.   put date2 into line 2 of card field "Target Date"
  348.   put round (weight1-y) into line 2 of card field "twlp"
  349.   put weight1-weight2 into card field "wt Loss"
  350.   put (weight1-weight2)/period*7 into meanloss
  351.   put round (meanloss*10)*.1 into card field "Mean Loss"
  352.   put weight2-y into card field "wtl"
  353.   put round((weight2-y)/((Days-period)/7)*10)*.1 into card field "AWL"
  354. end mouseUp
  355.  
  356.  
  357.  
  358. -- part 60 (field)
  359. -- low flags: 80
  360. -- high flags: 0004
  361. -- rect: left=276 top=193 right=214 bottom=453
  362. -- title width / last selected line: 0
  363. -- icon id / first selected line: 0 / 0
  364. -- text alignment: 0
  365. -- font id: 3
  366. -- text size: 12
  367. -- style flags: 256
  368. -- line height: 16
  369. -- part name: f6
  370.  
  371.  
  372. -- part 59 (field)
  373. -- low flags: 80
  374. -- high flags: 0004
  375. -- rect: left=276 top=211 right=232 bottom=453
  376. -- title width / last selected line: 0
  377. -- icon id / first selected line: 0 / 0
  378. -- text alignment: 0
  379. -- font id: 3
  380. -- text size: 12
  381. -- style flags: 256
  382. -- line height: 16
  383. -- part name: f7
  384.  
  385.  
  386. -- part 35 (field)
  387. -- low flags: 80
  388. -- high flags: 0004
  389. -- rect: left=450 top=193 right=214 bottom=489
  390. -- title width / last selected line: 0
  391. -- icon id / first selected line: 0 / 0
  392. -- text alignment: 0
  393. -- font id: 3
  394. -- text size: 12
  395. -- style flags: 256
  396. -- line height: 16
  397. -- part name: Wt Loss
  398.  
  399.  
  400. -- part 34 (field)
  401. -- low flags: 80
  402. -- high flags: 0004
  403. -- rect: left=450 top=211 right=231 bottom=489
  404. -- title width / last selected line: 0
  405. -- icon id / first selected line: 0 / 0
  406. -- text alignment: 0
  407. -- font id: 3
  408. -- text size: 12
  409. -- style flags: 256
  410. -- line height: 16
  411. -- part name: WOD
  412.  
  413.  
  414. -- part 57 (field)
  415. -- low flags: 80
  416. -- high flags: 0004
  417. -- rect: left=25 top=193 right=214 bottom=203
  418. -- title width / last selected line: 0
  419. -- icon id / first selected line: 0 / 0
  420. -- text alignment: 0
  421. -- font id: 3
  422. -- text size: 12
  423. -- style flags: 256
  424. -- line height: 16
  425. -- part name: f2
  426.  
  427.  
  428. -- part 37 (field)
  429. -- low flags: 80
  430. -- high flags: 0004
  431. -- rect: left=199 top=193 right=214 bottom=244
  432. -- title width / last selected line: 0
  433. -- icon id / first selected line: 0 / 0
  434. -- text alignment: 0
  435. -- font id: 3
  436. -- text size: 12
  437. -- style flags: 256
  438. -- line height: 16
  439. -- part name: wtl
  440.  
  441.  
  442. -- part 55 (field)
  443. -- low flags: 80
  444. -- high flags: 0004
  445. -- rect: left=25 top=211 right=231 bottom=202
  446. -- title width / last selected line: 0
  447. -- icon id / first selected line: 0 / 0
  448. -- text alignment: 0
  449. -- font id: 3
  450. -- text size: 12
  451. -- style flags: 256
  452. -- line height: 16
  453. -- part name: f3
  454.  
  455.  
  456. -- part 54 (field)
  457. -- low flags: 80
  458. -- high flags: 0004
  459. -- rect: left=25 top=228 right=248 bottom=202
  460. -- title width / last selected line: 0
  461. -- icon id / first selected line: 0 / 0
  462. -- text alignment: 0
  463. -- font id: 3
  464. -- text size: 12
  465. -- style flags: 256
  466. -- line height: 16
  467. -- part name: f4
  468.  
  469.  
  470. -- part 38 (field)
  471. -- low flags: 80
  472. -- high flags: 0004
  473. -- rect: left=199 top=211 right=231 bottom=244
  474. -- title width / last selected line: 0
  475. -- icon id / first selected line: 0 / 0
  476. -- text alignment: 0
  477. -- font id: 3
  478. -- text size: 12
  479. -- style flags: 256
  480. -- line height: 16
  481. -- part name: weeks
  482.  
  483.  
  484. -- part 61 (field)
  485. -- low flags: 80
  486. -- high flags: 0004
  487. -- rect: left=276 top=228 right=248 bottom=453
  488. -- title width / last selected line: 0
  489. -- icon id / first selected line: 0 / 0
  490. -- text alignment: 0
  491. -- font id: 3
  492. -- text size: 12
  493. -- style flags: 256
  494. -- line height: 16
  495. -- part name: f8
  496.  
  497.  
  498. -- part 36 (field)
  499. -- low flags: 80
  500. -- high flags: 0004
  501. -- rect: left=450 top=228 right=248 bottom=489
  502. -- title width / last selected line: 0
  503. -- icon id / first selected line: 0 / 0
  504. -- text alignment: 0
  505. -- font id: 3
  506. -- text size: 12
  507. -- style flags: 256
  508. -- line height: 16
  509. -- part name: Mean Loss
  510.  
  511.  
  512. -- part 58 (field)
  513. -- low flags: 80
  514. -- high flags: 2004
  515. -- rect: left=322 top=113 right=147 bottom=480
  516. -- title width / last selected line: 0
  517. -- icon id / first selected line: 0 / 0
  518. -- text alignment: 1
  519. -- font id: 3
  520. -- text size: 10
  521. -- style flags: 256
  522. -- line height: 13
  523. -- part name: twlp
  524.  
  525.  
  526. -- part 42 (field)
  527. -- low flags: 80
  528. -- high flags: 0004
  529. -- rect: left=168 top=269 right=306 bottom=339
  530. -- title width / last selected line: 0
  531. -- icon id / first selected line: 0 / 0
  532. -- text alignment: 1
  533. -- font id: 3
  534. -- text size: 12
  535. -- style flags: 256
  536. -- line height: 16
  537. -- part name: Target Date
  538.  
  539.  
  540. -- part 43 (field)
  541. -- low flags: 80
  542. -- high flags: 0004
  543. -- rect: left=199 top=228 right=248 bottom=244
  544. -- title width / last selected line: 0
  545. -- icon id / first selected line: 0 / 0
  546. -- text alignment: 0
  547. -- font id: 3
  548. -- text size: 12
  549. -- style flags: 256
  550. -- line height: 16
  551. -- part name: AWL
  552.  
  553.  
  554. -- part 64 (field)
  555. -- low flags: 80
  556. -- high flags: 0004
  557. -- rect: left=62 top=169 right=188 bottom=205
  558. -- title width / last selected line: 0
  559. -- icon id / first selected line: 0 / 0
  560. -- text alignment: 1
  561. -- font id: 3
  562. -- text size: 12
  563. -- style flags: 16640
  564. -- line height: 16
  565. -- part name: f1
  566.  
  567.  
  568. -- part 62 (field)
  569. -- low flags: 80
  570. -- high flags: 0004
  571. -- rect: left=311 top=169 right=188 bottom=454
  572. -- title width / last selected line: 0
  573. -- icon id / first selected line: 0 / 0
  574. -- text alignment: 1
  575. -- font id: 3
  576. -- text size: 12
  577. -- style flags: 16640
  578. -- line height: 16
  579. -- part name: f5
  580.  
  581.  
  582. -- part 65 (button)
  583. -- low flags: 80
  584. -- high flags: A003
  585. -- rect: left=221 top=87 right=106 bottom=312
  586. -- title width / last selected line: 0
  587. -- icon id / first selected line: 0 / 0
  588. -- text alignment: 1
  589. -- font id: 0
  590. -- text size: 12
  591. -- style flags: 0
  592. -- line height: 16
  593. -- part name: Plot it
  594. ----- HyperTalk script -----
  595. on mouseUp
  596.   set cursor to busy
  597.   hide background button "reset"
  598.   hide card button "instructions"
  599.   hide card button "calories"
  600.   hide card button "home"
  601.   hide card field "title"
  602.   show card field "message2"
  603.   wait 300
  604.   set lockscreen to true
  605.   push card
  606.  
  607.   hide card button "plot it"
  608.   hide card button "preferred lbs/week"
  609.   hide card button "preferred date"
  610.   hide card button "calculate"
  611.   hide card button "enter data"
  612.   hide card button "home"
  613.  
  614.   hide card field "wt now"
  615.   hide card field "y"
  616.   hide card field "twlp"
  617.   hide card field "f1"
  618.   hide card field "f5"
  619.   hide card field "f2"
  620.   hide card field "wtl"
  621.   hide card field "weeks"
  622.   hide card field "f4"
  623.   hide card field "f3"
  624.   hide card field "AWL"
  625.   hide card field "f6"
  626.   hide card field "f7"
  627.   hide card field "f8"
  628.   hide card field "wt loss"
  629.   hide card field "wod"
  630.   hide card field "mean loss"
  631.   hide card field "target date"
  632.  
  633.   put card field "date1" into date1
  634.   put card field "date2" into date2
  635.   put card field "a" into a
  636.   put card field "b" into b
  637.   put card field "count1" into count1
  638.   put card field "count2" into count2
  639.   put card field "v" into v
  640.   put card field "weight1" into weight1
  641.   put card field "weight2" into weight2
  642.  
  643.   put empty into xA
  644.   put empty into xB
  645.   put empty into yA
  646.   put empty into yB
  647.   put empty into maxWeight
  648.   put empty into minWeight
  649.  
  650.   put line 2 of card field "y" into TW
  651.   put weight1 into maxWeight
  652.   put weight1 into minWeight
  653.   put empty into count
  654.  
  655.   put (LN(TW)-v)/b into dateFinal
  656.   if dateFinal>365 then put (date2 - date1)/60/60/24 into dateFinal
  657.   if b = 0 then put (date2 - date1)/60/60/24 into dateFinal
  658.   put dateFinal into xRange
  659.   put maxWeight-TW into yRange
  660.   put 420/xRange into xFactor
  661.   put 260/yRange into yFactor
  662.   hide card field "message2"
  663.   set lockScreen to false
  664.   hide background field "mask7"
  665.   hide background button "mask5"
  666.   put empty into count
  667.   repeat with count = count1+1 to count2
  668.     put line count-1 of card field "Date" into dateA
  669.     put line count of card field "Date" into dateB
  670.     convert dateA to seconds
  671.     convert dateB to seconds
  672.     put (dateA - date1)/60/60/24 into xA
  673.     put (dateB - date1)/60/60/24 into xB
  674.     put 51 + (xA * xFactor) into xA
  675.     put 51 + (xB * xFactor) into xB
  676.     put line count-1 of card field "Weight" into yA
  677.     put line count of card field "Weight" into yB
  678.     put 311 - ((yA-TW) * yFactor) into yA
  679.     put 311 - ((yB-TW) * yFactor) into yB
  680.     choose line tool
  681.     set lineSize to 2
  682.     drag from round (xA), round (yA) to round (xB), round (yB)
  683.     choose browse tool
  684.   end repeat
  685.  
  686.   Choose line tool
  687.   set lineSize to 1
  688.   put empty into I
  689.   put 0 into x1
  690.   put round (xRange) into x2
  691.   hide background button "mask6"
  692.   repeat with x = x1  to x2
  693.     put I + 1 into I
  694.     put 311 - (((a * exp (b * x))-TW) * yFactor) into y
  695.     if I > 1 then put 51 + ((x-1) * xFactor) into u
  696.     if I > 1 then put 51 + (x * xFactor) into p
  697.     if I > 1 then put 311 - (((a * exp (b * (x-1)))-TW) * yFactor) into k
  698.     If I > 1 then drag from round (u), round (k) to round (p), round (Y)
  699.   end repeat
  700.  
  701.   set lockscreen to true
  702.   show background button "mask5"
  703.   show background button "mask6"
  704.   show background field "mask7"
  705.  
  706.   show card button "view graph"
  707.   show card button "preferred lbs/week"
  708.   show card button "preferred date"
  709.   show card button "calculate"
  710.   show card button "enter data"
  711.   show card button "home"
  712.   show card field "title"
  713.  
  714.   show card field "wt now"
  715.   show card field "y"
  716.   show card field "twlp"
  717.   show card field "f1"
  718.   show card field "f5"
  719.   show card field "f2"
  720.   show card field "wtl"
  721.   show card field "weeks"
  722.   show card field "f4"
  723.   show card field "f3"
  724.   show card field "AWL"
  725.   show card field "f6"
  726.   show card field "f7"
  727.   show card field "f8"
  728.   show card field "wt loss"
  729.   show card field "wod"
  730.   show card field "mean loss"
  731.   show card field "target date"
  732.   doMenu "Select all"
  733.   doMenu "Cut Picture"
  734.   go next card
  735.   doMenu "select All"
  736.   doMenu "clear picture"
  737.   domenu "Paste Picture"
  738.   pop card
  739.   doMenu "Background"
  740.   doMenu "select All"
  741.   doMenu "Copy Picture"
  742.   doMenu "Background"
  743.   go next card
  744.   doMenu "Paste Picture"
  745.   doMenu "Transparent"
  746.   choose browse tool
  747.   set lockscreen to false
  748. end mouseUp
  749.  
  750.  
  751.  
  752. -- part 66 (field)
  753. -- low flags: 80
  754. -- high flags: 0001
  755. -- rect: left=15 top=16 right=326 bottom=494
  756. -- title width / last selected line: 0
  757. -- icon id / first selected line: 0 / 0
  758. -- text alignment: 1
  759. -- font id: 3
  760. -- text size: 12
  761. -- style flags: 22784
  762. -- line height: 16
  763. -- part name: Message
  764.  
  765.  
  766. -- part 67 (button)
  767. -- low flags: 80
  768. -- high flags: A003
  769. -- rect: left=219 top=87 right=106 bottom=315
  770. -- title width / last selected line: 0
  771. -- icon id / first selected line: 0 / 0
  772. -- text alignment: 1
  773. -- font id: 0
  774. -- text size: 12
  775. -- style flags: 0
  776. -- line height: 16
  777. -- part name: View Graph
  778. ----- HyperTalk script -----
  779. on mouseUp
  780.   hide background button "reset"
  781.   hide card button "instructions"
  782.  
  783.   push card
  784.   visual effect dissolve slowly
  785.   go next card
  786. end mouseUp
  787.  
  788.  
  789.  
  790. -- part 68 (button)
  791. -- low flags: 00
  792. -- high flags: A003
  793. -- rect: left=37 top=56 right=79 bottom=128
  794. -- title width / last selected line: 0
  795. -- icon id / first selected line: 0 / 0
  796. -- text alignment: 1
  797. -- font id: 0
  798. -- text size: 12
  799. -- style flags: 0
  800. -- line height: 16
  801. -- part name: Clear Data
  802. ----- HyperTalk script -----
  803. on mouseUp
  804.   answer "delete data on screen ?" with "yes" or "No"
  805.   if it is "no" then exit mouseUp
  806.   select text of card field "date"
  807.   doMenu "Clear Text"
  808.   select text of card field "weight"
  809.   doMenu "Clear Text"
  810. end mouseUp
  811.  
  812.  
  813.  
  814. -- part 72 (button)
  815. -- low flags: 00
  816. -- high flags: 2005
  817. -- rect: left=174 top=77 right=95 bottom=193
  818. -- title width / last selected line: 0
  819. -- icon id / first selected line: 0 / 0
  820. -- text alignment: 1
  821. -- font id: 0
  822. -- text size: 12
  823. -- style flags: 0
  824. -- line height: 16
  825. -- part name: Check Errors
  826. ----- HyperTalk script -----
  827. on mouseUp
  828.   set cursor to busy
  829.   put empty into count
  830.   put number of lines of card field date into maxLines
  831.   repeat with count = 1 to maxLines
  832.     put count + 1 into counts
  833.     put line count of card field "date" into dates
  834.     put line counts of card field "date" into datess
  835.     if datess is empty then put dates into datess
  836.     convert dates to seconds
  837.     convert datess to seconds
  838.     put abs(datess - dates) into dif
  839.     if dif > 60 * 60 * 24 * 28 then put "Dates greater than 1 month apart in lines" && count & "," && counts
  840.     put line count of card field "weight" into w1
  841.     put line counts of card field "weight" into w2
  842.     if w2 is empty then put w1 into w2
  843.     put abs (w1 - w2) into wdif
  844.     if wdif > 10 then put "greater than 10 lbs between lines" && count & "," && counts
  845.     if dif > 60 * 60 * 24 * 28 then select line counts of card field "date"
  846.     if wdif > 10 then select line counts of card field "weight"
  847.     if wdif > 10 then put the scroll of card field "weight" into align
  848.     if wdif > 10 then set the scroll of card field "Date" to align
  849.     if wdif > 10 then exit repeat
  850.     if dif > 60 * 60 * 24 * 28 then put the scroll of card field "date" into align
  851.     if dif > 60 * 60 * 24 * 28 then set the scroll of card field "weight" to align
  852.     if dif > 60 * 60 * 24 * 28 then exit repeat
  853.   end repeat
  854.   if dif > 60 * 60 * 24 * 28 then answer "Better Re-check!!"
  855.   if wdif > 10 then answer "Better Re-check!!"
  856. end mouseUp
  857.  
  858.  
  859.  
  860. -- part 73 (field)
  861. -- low flags: 80
  862. -- high flags: 0000
  863. -- rect: left=48 top=80 right=98 bottom=121
  864. -- title width / last selected line: 0
  865. -- icon id / first selected line: 0 / 0
  866. -- text alignment: 0
  867. -- font id: 3
  868. -- text size: 12
  869. -- style flags: 0
  870. -- line height: 16
  871. -- part name: Date1
  872.  
  873.  
  874. -- part 74 (field)
  875. -- low flags: 80
  876. -- high flags: 0000
  877. -- rect: left=47 top=100 right=118 bottom=120
  878. -- title width / last selected line: 0
  879. -- icon id / first selected line: 0 / 0
  880. -- text alignment: 0
  881. -- font id: 3
  882. -- text size: 12
  883. -- style flags: 0
  884. -- line height: 16
  885. -- part name: Date2
  886.  
  887.  
  888. -- part 75 (field)
  889. -- low flags: 80
  890. -- high flags: 0000
  891. -- rect: left=47 top=121 right=139 bottom=120
  892. -- title width / last selected line: 0
  893. -- icon id / first selected line: 0 / 0
  894. -- text alignment: 0
  895. -- font id: 3
  896. -- text size: 12
  897. -- style flags: 0
  898. -- line height: 16
  899. -- part name: a
  900.  
  901.  
  902. -- part 76 (field)
  903. -- low flags: 80
  904. -- high flags: 0000
  905. -- rect: left=47 top=142 right=160 bottom=120
  906. -- title width / last selected line: 0
  907. -- icon id / first selected line: 0 / 0
  908. -- text alignment: 0
  909. -- font id: 3
  910. -- text size: 12
  911. -- style flags: 0
  912. -- line height: 16
  913. -- part name: b
  914.  
  915.  
  916. -- part 77 (field)
  917. -- low flags: 80
  918. -- high flags: 0000
  919. -- rect: left=47 top=165 right=183 bottom=120
  920. -- title width / last selected line: 0
  921. -- icon id / first selected line: 0 / 0
  922. -- text alignment: 0
  923. -- font id: 3
  924. -- text size: 12
  925. -- style flags: 0
  926. -- line height: 16
  927. -- part name: v
  928.  
  929.  
  930. -- part 78 (field)
  931. -- low flags: 80
  932. -- high flags: 0000
  933. -- rect: left=47 top=187 right=205 bottom=120
  934. -- title width / last selected line: 0
  935. -- icon id / first selected line: 0 / 0
  936. -- text alignment: 0
  937. -- font id: 3
  938. -- text size: 12
  939. -- style flags: 0
  940. -- line height: 16
  941. -- part name: count1
  942.  
  943.  
  944. -- part 81 (field)
  945. -- low flags: 80
  946. -- high flags: 0000
  947. -- rect: left=47 top=207 right=225 bottom=120
  948. -- title width / last selected line: 0
  949. -- icon id / first selected line: 0 / 0
  950. -- text alignment: 0
  951. -- font id: 3
  952. -- text size: 12
  953. -- style flags: 0
  954. -- line height: 16
  955. -- part name: count2
  956.  
  957.  
  958. -- part 82 (field)
  959. -- low flags: 80
  960. -- high flags: 0000
  961. -- rect: left=46 top=229 right=247 bottom=119
  962. -- title width / last selected line: 0
  963. -- icon id / first selected line: 0 / 0
  964. -- text alignment: 0
  965. -- font id: 3
  966. -- text size: 12
  967. -- style flags: 0
  968. -- line height: 16
  969. -- part name: weight1
  970.  
  971.  
  972. -- part 83 (field)
  973. -- low flags: 80
  974. -- high flags: 0000
  975. -- rect: left=46 top=250 right=268 bottom=119
  976. -- title width / last selected line: 0
  977. -- icon id / first selected line: 0 / 0
  978. -- text alignment: 0
  979. -- font id: 3
  980. -- text size: 12
  981. -- style flags: 0
  982. -- line height: 16
  983. -- part name: weight2
  984.  
  985.  
  986. -- part 85 (button)
  987. -- low flags: 80
  988. -- high flags: 0000
  989. -- rect: left=454 top=19 right=47 bottom=491
  990. -- title width / last selected line: 0
  991. -- icon id / first selected line: 1011 / 1011
  992. -- text alignment: 1
  993. -- font id: 0
  994. -- text size: 12
  995. -- style flags: 0
  996. -- line height: 16
  997. -- part name: Home
  998. ----- HyperTalk script -----
  999. on mouseUp
  1000.   go home
  1001. end mouseUp
  1002.  
  1003.  
  1004.  
  1005. -- part 86 (button)
  1006. -- low flags: 00
  1007. -- high flags: 0005
  1008. -- rect: left=0 top=3 right=15 bottom=16
  1009. -- title width / last selected line: 0
  1010. -- icon id / first selected line: 0 / 0
  1011. -- text alignment: 1
  1012. -- font id: 0
  1013. -- text size: 12
  1014. -- style flags: 0
  1015. -- line height: 16
  1016. -- part name: quit
  1017. ----- HyperTalk script -----
  1018. on mouseUp
  1019.   doMenu "quit Hypercard"
  1020. end mouseUp
  1021.  
  1022.  
  1023.  
  1024. -- part 87 (button)
  1025. -- low flags: 00
  1026. -- high flags: A003
  1027. -- rect: left=391 top=55 right=76 bottom=492
  1028. -- title width / last selected line: 0
  1029. -- icon id / first selected line: 0 / 0
  1030. -- text alignment: 1
  1031. -- font id: 0
  1032. -- text size: 12
  1033. -- style flags: 0
  1034. -- line height: 16
  1035. -- part name: Get Equation
  1036. ----- HyperTalk script -----
  1037. on mouseUp
  1038.   set cursor to busy
  1039.   put empty into I
  1040.   put empty into totx
  1041.   put empty into totz
  1042.   put empty into totxx
  1043.   put empty into totxz
  1044.   put empty into totzz
  1045.   put empty into a
  1046.   put empty into b
  1047.   put empty into v
  1048.   put empty into count1
  1049.   put empty into count2
  1050.  
  1051.   repeat
  1052.     put count1+1 into count1
  1053.     put line count1 of card field "date" into date
  1054.     if date is not empty then exit repeat
  1055.     if count1>10 then put "resetting Data"
  1056.     if count1>10 then exit repeat
  1057.   end repeat
  1058.  
  1059.   repeat
  1060.     put count2+1 into count2
  1061.     if count1>10 then exit repeat
  1062.     put line count2 of card field "date" into date
  1063.     if date is empty then exit repeat
  1064.   end repeat
  1065.  
  1066.   put count2-1 into count2
  1067.   put line count1 of card field "date" into date1
  1068.   put line count2 of card field "date" into date2
  1069.   convert date1 to seconds
  1070.   convert date2 to seconds
  1071.   put empty into count
  1072.  
  1073.   if count2 - count1 < 2 then answer "require at least 3 data pairs"
  1074.   if count2 - count1 < 2 then put empty into card field "equation"
  1075.   if count2 - count1 < 2 then show card button "home"
  1076.   if count2 - count1 < 2 then exit mouseUp
  1077.  
  1078.  
  1079.   hide card button "Home"
  1080.   hide background button "reset"
  1081.   hide card button "Get Equation"
  1082.   hide card button "clear data"
  1083.   hide card button "Store Data"
  1084.   hide card button "Retrieve Data"
  1085.   hide card button "Exchange Data"
  1086.   hide card button "Check Errors"
  1087.   hide card field "title1"
  1088.   hide card field "title2"
  1089.   hide card field "Date"
  1090.   hide card field "Weight"
  1091.   hide card button "instructions"
  1092.   if count2 > 10 then show card field "message"
  1093.   set lockscreen to true
  1094.  
  1095.  
  1096.   show card button "Home"
  1097.   show card button "Enter Data"
  1098.   show card button "Calculate"
  1099.   hide card button "Mask1"
  1100.   hide card button "Mask2"
  1101.   hide card button "Mask3"
  1102.  
  1103.   show card field "y"
  1104.   show card field "wt now"
  1105.   show card field "twlp"
  1106.   show card field "Target Date"
  1107.   show card field "f1"
  1108.   show card field "f2"
  1109.   show card field "f3"
  1110.   show card field "f4"
  1111.   show card field "f5"
  1112.   show card field "f6"
  1113.   show card field "f7"
  1114.   show card field "f8"
  1115.   show card field "wtl"
  1116.   show card field "weeks"
  1117.   show card field "awl"
  1118.   show card field "wt loss"
  1119.   show card field "WOD"
  1120.   show card field "mean loss"
  1121.  
  1122.   repeat with count = count1 to count2
  1123.     if count1>10 then exit repeat
  1124.     put line count of card field "weight" into y
  1125.     if count = count1 then put line count of card field "weight" into weight1
  1126.     if count = count2 then put line count of card field "weight" into weight2
  1127.     put line count of card field "date" into dates
  1128.     put I + 1 into I
  1129.     convert dates to seconds
  1130.     put (dates - date1)/60/60/24 into x
  1131.     put totx + x into totx
  1132.     put LN (y) into z
  1133.     put totzz + z * z into totzz
  1134.     put totz + z into totz
  1135.     put totxx + x * x into totxx
  1136.     put totxz + x * z into totxz
  1137.   end repeat
  1138.   put I into n
  1139.   put (n  * totxz - totx * totz)/(n * totxx - totx *  totx) into b
  1140.   put (totz/n - b * totx/n) into v
  1141.   put exp(v) into a
  1142.   put (n*totxz-totx*totz)/sqrt((n*totxx-totx*totx)*(n*totzz-totz*totz)) into r
  1143.   put "y=" & a & "*exp(" & b & "*X)" into card field "Equation"
  1144.   if count1>10 then put empty into card field "Equation"
  1145.   put weight2 into line 2 of card field "wt Now"
  1146.   put date1 into card field "Date1"
  1147.   put date2 into card field "date2"
  1148.   put a into card field "a"
  1149.   put b into card field "b"
  1150.   put v into card field "v"
  1151.   put count1 into card field "count1"
  1152.   put count2 into card field "count2"
  1153.   put weight1 into card field "weight1"
  1154.   put weight2 into card field "weight2"
  1155.  
  1156.   hide card field "date1"
  1157.   hide card field "date2"
  1158.   hide card field "a"
  1159.   hide card field "b"
  1160.   hide card field "v"
  1161.   hide card field "count1"
  1162.   hide card field "count2"
  1163.   hide card field "weight1"
  1164.   hide card field "weight2"
  1165.   hide card field "equation"
  1166.   show card button "instructions"
  1167.   show card button "calories"
  1168.   hide card field "message"
  1169.   set lockscreen to false
  1170.   if -r<= 0.9 then put "Regular dieting/exercise required!!--r is only " && -(round (abs(r)*1000))*.001
  1171.   if -r<=0.9 then wait 240
  1172.   if -r<=0.9 then doMenu "message"
  1173.  
  1174.   if -r>0.9 then put "steady weight loss being made!!--r is high at" && -(round(abs(r)*1000))*.001
  1175.   if -r>0.9 then wait 240
  1176.   if -r>0.9 then doMenu "message"
  1177.  
  1178. end mouseUp
  1179.  
  1180.  
  1181.  
  1182. -- part 89 (field)
  1183. -- low flags: 00
  1184. -- high flags: 0000
  1185. -- rect: left=205 top=14 right=34 bottom=351
  1186. -- title width / last selected line: 0
  1187. -- icon id / first selected line: 0 / 0
  1188. -- text alignment: 1
  1189. -- font id: 3
  1190. -- text size: 12
  1191. -- style flags: 23808
  1192. -- line height: 16
  1193. -- part name: Title
  1194.  
  1195.  
  1196. -- part 90 (button)
  1197. -- low flags: 00
  1198. -- high flags: A003
  1199. -- rect: left=35 top=89 right=111 bottom=135
  1200. -- title width / last selected line: 0
  1201. -- icon id / first selected line: 0 / 0
  1202. -- text alignment: 1
  1203. -- font id: 0
  1204. -- text size: 12
  1205. -- style flags: 0
  1206. -- line height: 16
  1207. -- part name: Store Data
  1208. ----- HyperTalk script -----
  1209. on mouseUp
  1210.   answer "save data on screen and clear fields?" with "yes" or "No"
  1211.   if it is "no" then exit mouseUp
  1212.   put last char of card field "Title" into I
  1213.   if I=1 then put 2 into I else put 1 into I
  1214.   put I into last char of card field title
  1215.   get card field "date"
  1216.   put it into card field "store date"
  1217.   get card field "weight"
  1218.   put it into card field "store weight"
  1219.   select text of card field "date"
  1220.   doMenu "Clear Text"
  1221.   select text of card field "weight"
  1222.   doMenu "Clear Text"
  1223. end mouseUp
  1224.  
  1225.  
  1226.  
  1227. -- part 91 (button)
  1228. -- low flags: 00
  1229. -- high flags: A003
  1230. -- rect: left=33 top=120 right=141 bottom=136
  1231. -- title width / last selected line: 0
  1232. -- icon id / first selected line: 0 / 0
  1233. -- text alignment: 1
  1234. -- font id: 0
  1235. -- text size: 12
  1236. -- style flags: 0
  1237. -- line height: 16
  1238. -- part name: Retrieve Data
  1239. ----- HyperTalk script -----
  1240. on mouseUp
  1241.   answer "replace data on screen with stored data ?" with "yes" or "No"
  1242.   if it is "no" then exit mouseUp
  1243.   put last char of card field "Title" into I
  1244.   if I=1 then put 2 into I else put 1 into I
  1245.   put I into last char of card field title
  1246.   get card field "store date"
  1247.   put it into card field "date"
  1248.   get card field "store weight"
  1249.   put it into card field "weight"
  1250. end mouseUp
  1251.  
  1252.  
  1253.  
  1254. -- part 92 (field)
  1255. -- low flags: 80
  1256. -- high flags: 0007
  1257. -- rect: left=177 top=286 right=317 bottom=313
  1258. -- title width / last selected line: 0
  1259. -- icon id / first selected line: 0 / 0
  1260. -- text alignment: 0
  1261. -- font id: 3
  1262. -- text size: 12
  1263. -- style flags: 0
  1264. -- line height: 16
  1265. -- part name: Store Date
  1266.  
  1267.  
  1268. -- part 93 (field)
  1269. -- low flags: 80
  1270. -- high flags: 0007
  1271. -- rect: left=177 top=286 right=317 bottom=313
  1272. -- title width / last selected line: 0
  1273. -- icon id / first selected line: 0 / 0
  1274. -- text alignment: 0
  1275. -- font id: 3
  1276. -- text size: 12
  1277. -- style flags: 0
  1278. -- line height: 16
  1279. -- part name: Store Weight
  1280.  
  1281.  
  1282. -- part 98 (button)
  1283. -- low flags: 00
  1284. -- high flags: A003
  1285. -- rect: left=35 top=150 right=172 bottom=135
  1286. -- title width / last selected line: 0
  1287. -- icon id / first selected line: 0 / 0
  1288. -- text alignment: 1
  1289. -- font id: 0
  1290. -- text size: 12
  1291. -- style flags: 0
  1292. -- line height: 16
  1293. -- part name: Exchange Data
  1294. ----- HyperTalk script -----
  1295. on mouseUp
  1296.   answer "exchange screen data with stored data ?" with "yes" or "No"
  1297.   if it is "no" then exit mouseUp
  1298.   put last char of card field "Title" into I
  1299.   if I=1 then put 2 into I else put 1 into I
  1300.   put I into last char of card field title
  1301.   get card field "date"
  1302.   put it into card field "exchange date"
  1303.   get card field "weight"
  1304.   put it into card field "exchange weight"
  1305.   get card field "store date"
  1306.   put it into card field "date"
  1307.   get card field "store weight"
  1308.   put it into card field "weight"
  1309.   get card field "exchange date"
  1310.   put it into card field "store date"
  1311.   get card field "exchange weight"
  1312.   put it into card field "store weight"
  1313. end mouseUp
  1314.  
  1315.  
  1316.  
  1317. -- part 99 (field)
  1318. -- low flags: 80
  1319. -- high flags: 0007
  1320. -- rect: left=221 top=255 right=286 bottom=343
  1321. -- title width / last selected line: 0
  1322. -- icon id / first selected line: 0 / 0
  1323. -- text alignment: 0
  1324. -- font id: 3
  1325. -- text size: 12
  1326. -- style flags: 0
  1327. -- line height: 16
  1328. -- part name: Exchange Date
  1329.  
  1330.  
  1331. -- part 100 (field)
  1332. -- low flags: 80
  1333. -- high flags: 0007
  1334. -- rect: left=220 top=255 right=286 bottom=342
  1335. -- title width / last selected line: 0
  1336. -- icon id / first selected line: 0 / 0
  1337. -- text alignment: 0
  1338. -- font id: 3
  1339. -- text size: 12
  1340. -- style flags: 0
  1341. -- line height: 16
  1342. -- part name: Exchange Weight
  1343.  
  1344.  
  1345. -- part 101 (field)
  1346. -- low flags: 80
  1347. -- high flags: 0001
  1348. -- rect: left=15 top=16 right=326 bottom=494
  1349. -- title width / last selected line: 0
  1350. -- icon id / first selected line: 0 / 0
  1351. -- text alignment: 1
  1352. -- font id: 3
  1353. -- text size: 12
  1354. -- style flags: 22784
  1355. -- line height: 16
  1356. -- part name: Message2
  1357.  
  1358.  
  1359. -- part 104 (field)
  1360. -- low flags: 80
  1361. -- high flags: 0007
  1362. -- rect: left=15 top=17 right=326 bottom=495
  1363. -- title width / last selected line: 0
  1364. -- icon id / first selected line: 0 / 0
  1365. -- text alignment: 0
  1366. -- font id: 3
  1367. -- text size: 12
  1368. -- style flags: 0
  1369. -- line height: 16
  1370. -- part name: Instructions
  1371.  
  1372.  
  1373. -- part 105 (button)
  1374. -- low flags: 80
  1375. -- high flags: 8006
  1376. -- rect: left=16 top=16 right=32 bottom=121
  1377. -- title width / last selected line: 0
  1378. -- icon id / first selected line: 0 / 0
  1379. -- text alignment: 1
  1380. -- font id: 0
  1381. -- text size: 12
  1382. -- style flags: 0
  1383. -- line height: 16
  1384. -- part name: Instructions
  1385. ----- HyperTalk script -----
  1386. on mouseUp
  1387.   hide card button "instructions"
  1388.   hide card button "calories"
  1389.   show card field "instructions"
  1390.   show card button "OK"
  1391. end mouseUp
  1392.  
  1393.  
  1394.  
  1395. -- part 106 (button)
  1396. -- low flags: 80
  1397. -- high flags: 8003
  1398. -- rect: left=367 top=29 right=51 bottom=467
  1399. -- title width / last selected line: 0
  1400. -- icon id / first selected line: 0 / 0
  1401. -- text alignment: 1
  1402. -- font id: 0
  1403. -- text size: 12
  1404. -- style flags: 0
  1405. -- line height: 16
  1406. -- part name: OK
  1407. ----- HyperTalk script -----
  1408. on mouseUp
  1409.   hide card field "instructions"
  1410.   hide card button "OK"
  1411.   show card button "instructions"
  1412.   show card button "calories"
  1413. end mouseUp
  1414.  
  1415.  
  1416.  
  1417. -- part 107 (field)
  1418. -- low flags: 80
  1419. -- high flags: 4002
  1420. -- rect: left=29 top=35 right=235 bottom=201
  1421. -- title width / last selected line: 0
  1422. -- icon id / first selected line: 0 / 0
  1423. -- text alignment: 0
  1424. -- font id: 3
  1425. -- text size: 12
  1426. -- style flags: 0
  1427. -- line height: 16
  1428. -- part name: TableM
  1429.  
  1430.  
  1431. -- part 108 (field)
  1432. -- low flags: 80
  1433. -- high flags: 4002
  1434. -- rect: left=29 top=34 right=234 bottom=201
  1435. -- title width / last selected line: 0
  1436. -- icon id / first selected line: 0 / 0
  1437. -- text alignment: 0
  1438. -- font id: 3
  1439. -- text size: 12
  1440. -- style flags: 0
  1441. -- line height: 16
  1442. -- part name: TableF
  1443.  
  1444.  
  1445. -- part 109 (button)
  1446. -- low flags: 80
  1447. -- high flags: 8006
  1448. -- rect: left=16 top=33 right=53 bottom=94
  1449. -- title width / last selected line: 0
  1450. -- icon id / first selected line: 0 / 0
  1451. -- text alignment: 1
  1452. -- font id: 0
  1453. -- text size: 12
  1454. -- style flags: 0
  1455. -- line height: 16
  1456. -- part name: Calories
  1457. ----- HyperTalk script -----
  1458. on mouseUp
  1459.   put empty into count
  1460.   put empty into row
  1461.   put empty into age
  1462.   put empty into weight
  1463.   put empty into ages
  1464.   put empty into w
  1465.   ask "Today's weight ?"
  1466.   put it into wtNow
  1467.   ask "Your Age (20-60) ?"
  1468.   put it into "age"
  1469.   if age <20 then answer "ages 20-60 only!"
  1470.   if age <20 then exit mouseUp
  1471.   if age >60 then answer "ages 20-60 only!"
  1472.   if age >60 then exit mouseUp
  1473.   if age <=35 then put 20 into age
  1474.   if age >35 then
  1475.     if age <= 50 then put 40 into age
  1476.   end if
  1477.   if age >50 then
  1478.     if age <= 60 then put 60 into age
  1479.   end if
  1480.   answer "sex" with "male" or "female"
  1481.   put it into sex
  1482.   if sex is "female" then ask "target weight (100-170lbs) ?" else ask "target weight (100-200lbs) ?"
  1483.   put it into y
  1484.   put round((y/10))*10 into weight
  1485.   if sex is "female" and weight <100 then answer "weight too low!"
  1486.   if sex is "male" and weight <100 then answer "weight too low!"
  1487.   if sex is "female" and weight >200 then answer "weight too high!"
  1488.   if sex is "female" and weight >170 then answer "weight too high!"
  1489.   if sex is "female" and weight <100 then exit mouseUp
  1490.   if sex is "male" and weight <100 then exit mouseUp
  1491.   if sex is "female" and weight >170 then exit mouseUp
  1492.   if sex is "male" and weight >200 then exit mouseUp
  1493.   repeat with count=1 to 11
  1494.     if sex is "male" then put item 1 of line count of card field "TableM" into w
  1495.     if sex is "female" then put item 1 of line count of card field "tableF" into w
  1496.     if w=weight then exit repeat
  1497.   end repeat
  1498.   repeat with row=2 to 4
  1499.     put item row of line 1 of card field "TableM" into ages
  1500.     if ages=age then exit repeat
  1501.   end repeat
  1502.   if sex is "male" then put item row of line count of card field "TableM" into Cal
  1503.   if sex is "female" then put item row of line count of card field "TableF" into Cal
  1504.   ask "Target Date (mm/dd/yy) ?"
  1505.   put it into TDate
  1506.   convert Tdate to seconds
  1507.   put the date into date1
  1508.   convert date1 to seconds
  1509.   put Tdate-date1 into time
  1510.   put time/60/24/60 into days
  1511.   put wtnow - y into lbs
  1512.   put lbs/days into ppd
  1513.   put cal-ppd*3600 into cals
  1514.   if ppd*3600>cal then answer "Impossible--or lots of excercise required!!"
  1515.   if ppd*3600>cal then exit mouseUp
  1516.   if ppd<0 then answer "Impossible--or lots of excercise required!!"
  1517.   if ppd<0 then exit mouseUp
  1518.   put "lbs/day ="&& (round (ppd*10))*.1 && "    cals/day =" && round (cals) && "    cals to maintain weight =" && Cal
  1519.   set lockscreen to true
  1520.   answer "Not many calories huh!!!"
  1521.   set lockscreen to false
  1522.   doMenu "message"
  1523. end mouseUp
  1524.  
  1525.  
  1526.  
  1527. -- part contents for card part 2
  1528. ----- text -----
  1529. HyperCalc,  by Dan Winkler
  1530.  
  1531. Change any number in the first column, or equation in the second column, then click outside the field to recalculate.  For each field, the first line should be the name; the second line a value; the third line an optional equation.
  1532.  
  1533. Copyright ¬©1987 Apple Computer Inc.
  1534.  
  1535. -- part contents for card part 25
  1536. ----- text -----
  1537. Date
  1538.  
  1539. -- part contents for card part 26
  1540. ----- text -----
  1541. Weight (lbs)
  1542.  
  1543. -- part contents for card part 28
  1544. ----- text -----
  1545. Target Weight (lbs)
  1546. 180
  1547.  
  1548. -- part contents for card part 29
  1549. ----- text -----
  1550. Today‚Äôs Weight (200lbs)
  1551. 227
  1552.  
  1553. -- part contents for card part 34
  1554. ----- text -----
  1555. 111.4
  1556.  
  1557. -- part contents for card part 38
  1558. ----- text -----
  1559. -82.6
  1560.  
  1561. -- part contents for card part 42
  1562. ----- text -----
  1563. Target Date
  1564. Sun, Mar 5, 1989
  1565.  
  1566. -- part contents for card part 35
  1567. ----- text -----
  1568. 31
  1569.  
  1570. -- part contents for card part 36
  1571. ----- text -----
  1572. 0.3
  1573.  
  1574. -- part contents for card part 37
  1575. ----- text -----
  1576. 47
  1577.  
  1578. -- part contents for card part 43
  1579. ----- text -----
  1580. -.6
  1581.  
  1582. -- part contents for card part 54
  1583. ----- text -----
  1584. Remaining Weekly Loss
  1585.  
  1586. -- part contents for card part 55
  1587. ----- text -----
  1588. Weeks To Go
  1589.  
  1590. -- part contents for card part 57
  1591. ----- text -----
  1592. Pounds To Go
  1593.  
  1594. -- part contents for card part 58
  1595. ----- text -----
  1596. Target Weight Loss (lbs)
  1597. 78
  1598.  
  1599. -- part contents for card part 59
  1600. ----- text -----
  1601. Weeks On Diet So Far
  1602.  
  1603. -- part contents for card part 60
  1604. ----- text -----
  1605. Weight Loss So Far
  1606.  
  1607. -- part contents for card part 61
  1608. ----- text -----
  1609. Average Weekly Loss
  1610.  
  1611. -- part contents for card part 62
  1612. ----- text -----
  1613. Diet Data So Far
  1614.  
  1615. -- part contents for card part 64
  1616. ----- text -----
  1617. Projected Data
  1618.  
  1619. -- part contents for card part 66
  1620. ----- text -----
  1621.  
  1622.                   
  1623.  
  1624.  
  1625.  
  1626. This may take a few moments!!
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633. Perhaps you should make the COFFEE!!!
  1634.  
  1635.  
  1636. -- part contents for card part 75
  1637. ----- text -----
  1638. 254.342386
  1639.  
  1640. -- part contents for card part 76
  1641. ----- text -----
  1642. -.001709
  1643.  
  1644. -- part contents for card part 77
  1645. ----- text -----
  1646. 5.538681
  1647.  
  1648. -- part contents for card part 78
  1649. ----- text -----
  1650. 1
  1651.  
  1652. -- part contents for card part 81
  1653. ----- text -----
  1654. 27
  1655.  
  1656. -- part contents for card part 82
  1657. ----- text -----
  1658. 258
  1659.  
  1660. -- part contents for card part 83
  1661. ----- text -----
  1662. 227
  1663.  
  1664. -- part contents for card part 89
  1665. ----- text -----
  1666. Diet Data 1
  1667.  
  1668. -- part contents for card part 101
  1669. ----- text -----
  1670.  
  1671.  
  1672.  
  1673. Watch the Graph
  1674. being Plotted
  1675.  
  1676.  
  1677.  
  1678. Graph shows the weight loss 
  1679. (in terms of % of Target weight)
  1680.  
  1681. Vs
  1682.  
  1683. the time on diet
  1684.  (in terms of % of projected date)
  1685.  
  1686.  
  1687.  
  1688. -- part contents for card part 104
  1689. ----- text -----
  1690.                                              About this Stack:
  1691.  
  1692.                                  Written by-- P. A. Bosomworth.
  1693.  
  1694.              any comments/questions-- write:   1010 Highland Avenue
  1695.                                                                       Hendersonville, NC, 28739
  1696.  
  1697.               please send a $2.00 donation if you like this stack.
  1698.  
  1699. Stack is useful for those monitoring their weight loss during dieting.
  1700. --it's great if your trying to win a weight-loss bet!!
  1701.  
  1702. By entering the date (in mm/dd/yy format; e.g. 10/10/88) into the date field, and your weight into the weight field, the program fits an exponential curve to the data points ( if you stick to a diet plan then your weight loss will probably be exponential; i.e. weight loss rate gets smaller as you lose weight). From this curve, the date by which you will be at a given weight ("target weight") is estimated. 
  1703.  
  1704. A graph of the percentage of the weight loss required to reach the target weight is plotted against the percentage of the time required to reach the target weight; e.g. 50% weight means that you have lost half of the total weight loss that you want to lose, and 50% date means that you are half way through the diet. Because the curve is an exponential you will have lost half the total weight loss desired before the diet is half way through.
  1705.  
  1706. Most of the buttons are self explanatory and are only visible when they can achieve something; e.g. a "graph plot" button is pressed when you want to plot the data. After the data is plotted, this button disappears and replaced by a "view graph" button.
  1707.  
  1708.                    
  1709.  
  1710.                                           Using this Program.
  1711.  
  1712. 1. Press the "enter data" button and enter the date/weight data into the appropriate fields.  Note, after entering the first date, press the "enter key" (this automatically moves to the last line of the next field). To enter more data after the scrolling field is full, drag the scroll bar to the bottom and an extra line is automatically added for data entry.
  1713.  
  1714. 2. After the data has been entered, press the get "equation button".
  1715.  
  1716. 3. Next, press the "plot it" button if you want a graph plotting (press the "print" icon to print the graph, or the "return" icon to get back to the calculation buttons)
  1717.  
  1718. 4. If you plotted a graph and are back at the calculation buttons, then you can view the graph by pressing the "view graph" button"
  1719.  
  1720. 5. You can get the target date after 2. or after 3., by pressing the "calculation" button (this is only visible when you can calculate something).
  1721.  
  1722. 6. At any time it is visible, you can press the "preferred lbs/week" button. This asks you for the weight you want to lose each week and then calculates the date at which you will reach your target weight.
  1723.  
  1724. 7. Similarly to 6. you can press the "preferred date" button. This calculates the weight loss per week required to get down to the target weight by a given date.
  1725.  
  1726. 8. Similarly to 6. you can press the "Calories" button. This calculates the number of calories you should be eating to get down to the target weight in a specified time.  Of course, the calorific values given are only estimates, and will be higher for an active person or lower for a sedatory person. In addition, the calories required to maintain the target weight are also given.
  1727.  
  1728.  
  1729.  
  1730.                                                Features
  1731.  
  1732. ‚Ä¢ if the system crashes or the computer is turned off accidentally while executing the stack, a reset button is visible on re-opening the stack. On pressing, this button resets the buttons and fields, but leaves the previous data intact.
  1733.  
  1734. ‚Ä¢ the data in the fields can be cleared, stored (1 set only!) or exchanged for previously stored data. This is ideal for 1 or 2 users.
  1735.  
  1736. ‚Ä¢ by pressing the check box at the top left hand side of the "date" field after the data has been entered, any suspect data is highlighted, and the line number given; e.g. a weight difference of more than 10lbs, or a date difference of more than 1 month from the previous line, will be selected.
  1737.  
  1738. ‚Ä¢ the "goodness of fit" of the exponential curve to the data is measured and shown in the message box. The correlation coefficient, r, is used as this measure, and ranges from -1 t0 +1. A value of -1 indicates a perfect fit of the exponential decay curve to the data, whereas 0 indicates no fit at all. A value greater than 0.8 means that the program shoukd give a reasonable estimate of the target date.
  1739.  
  1740. ‚Ä¢ the data entry fields are automatically aligned after the scroll bar has been moved.
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747. -- part contents for card part 73
  1748. ----- text -----
  1749. 2670451200
  1750.  
  1751. -- part contents for card part 74
  1752. ----- text -----
  1753. 2676844800
  1754.  
  1755. -- part contents for background part 49
  1756. ----- text -----
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773. -- part contents for card part 107
  1774. ----- text -----
  1775. #,20,40,60
  1776. 100,<2200,<1950,<1650
  1777. 110,2200,1950,1650
  1778. 120,2200,1950,1650
  1779. 130,2400,2150,1850
  1780. 140,2550,2300,1950
  1781. 150,2700,2400,2050
  1782. 160,2900,2600,2200
  1783. 170,3100,2800,2400
  1784. 180,3250,2950,2500
  1785. 190,3300,3100,2600
  1786. 200,3300,3100,2600
  1787.  
  1788. -- part contents for card part 108
  1789. ----- text -----
  1790. #,20,40,60
  1791. 100,1700,1500,1300
  1792. 110,1850,1650,1400
  1793. 120,1850,1650,1400
  1794. 130,2100,1900,1600
  1795. 140,2150,1950,1650
  1796. 150,2300,2050,1800
  1797. 160,2400,2150,1850
  1798. 170,2550,2300,1950
  1799.